package com.itheima.mall.web.oms;


import com.itheima.mall.commons.result.Result;
import com.itheima.mall.dubbo.api.oms.CompanyAddressService;
import com.itheima.mall.entity.domain.oms.CompanyAddress;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 公司收发货地址表 前端控制器
 * </p>
 *
 * @author qinglang
 * @since 2022-07-05
 */
@RestController
@RequestMapping("/companyAddress")
@CrossOrigin(origins = "*")
public class CompanyAddressController {
    @DubboReference
    private CompanyAddressService addressService;
    /**
     * 获取所有收货地址
     * @return
     */
    @GetMapping("/list")
    public Result list(){
        List<CompanyAddress> list = addressService.list();
        return Result.success(list);
    }



}

